{extend name="layouts/main" /}
<!-- <script type="text/javascript">
	KindEditor.ready(function(K) {
		/* var editor1 = K.create('textarea[name="description3"]', {
			// 指定编辑器iframe document的CSS文件，用于设置可视化区域的样式。
			cssPath : '__STATIC__/common/libs/kindeditor/plugins/code/prettify.css',
			// 指定上传文件的服务器端程序。
			uploadJson : GV.kindeditor_upload_url,
			// 指定浏览远程图片的服务器端程序。
			fileManagerJson : GV.kindeditor_file_manager_url,
			filterMode : false, //关闭过滤模式
			wellFormatMode : false, //true时美化HTML数据。false关闭美化
			newlineTag : "br", //设置回车换行标签，可设置”p”、”br”。数据类型: String 默认值: “p”
			pasteType : 2, //设置粘贴类型，0:禁止粘贴, 1:纯文本粘贴, 2:HTML粘贴 数据类型: Int 默认值: 2
			allowFileManager : true, //true时显示浏览远程服务器按钮。
			// 改变站内本地URL，可设置空、relative、absolute、domain。空为不修改URL，relative为相对路径，absolute为绝对路径，domain为带域名的绝对路径。数据类型：String
			// 默认值：空
			// 注: 3.4版本开始支持，3.4.1版本开始默认值为空。
			// urlType:'domain',
			// 编辑器的宽度，可以设置px或%，比textarea输入框样式表宽度优先度高。数据类型: String 默认值: textarea输入框的宽度
			width : '100%',
			// 编辑器的高度，只能设置px，比textarea输入框样式表高度优先度高。数据类型: String 默认值: textarea输入框的高度
			height : '390px',
			afterUpload:function(){ this.sync(); }, //图片上传后，将上传内容同步到textarea中
			afterBlur:function(){ this.sync(); }, //解决KindEditor编辑器Ajax表单提交时获取不到值问题
			// 设置编辑器创建后执行的回调函数。
			afterCreate : function() {
				var self = this;
				K.ctrl(document, 13, function() {
					self.sync();
					K('form[name=example]')[0].submit();
				});
				K.ctrl(self.edit.doc, 13, function() {
					self.sync();
					K('form[name=example]')[0].submit();
				});
			},
			// 编辑器工具
			items:[
				'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
				'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
				'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
				// 'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
				// 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
				// 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
				// 'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
				// 'anchor', 'link', 'unlink', '|', 'about'
			],
			// 上面的filterMode为true时以下就是要保留的标签
			htmlTags:{
				font : ['color', 'size', 'face', '.background-color'],
				span : [
					'.color', '.background-color', '.font-size', '.font-family', '.background',
					'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height'
				],
				div : [
					'align', '.border', '.margin', '.padding', '.text-align', '.color',
					'.background-color', '.font-size', '.font-family', '.font-weight', '.background',
					'.font-style', '.text-decoration', '.vertical-align', '.margin-left'
				],
				table: [
					'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor',
					'.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color',
					'.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background',
					'.width', '.height', '.border-collapse'
				],
				'td,th': [
					'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor',
					'.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
					'.font-style', '.text-decoration', '.vertical-align', '.background', '.border'
				],
				a : ['href', 'target', 'name'],
				embed : ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
				img : ['src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
				'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
				'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
				'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
				],
				pre : ['class'],
				hr : ['class', '.page-break-after'],
				'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del' : []
			}
		});
		prettyPrint(); */
		var editor2 = K.create('textarea[name="content"]', {
			// 指定编辑器iframe document的CSS文件，用于设置可视化区域的样式。
			cssPath : '__STATIC__/common/libs/kindeditor/plugins/code/prettify.css',
			// 指定上传文件的服务器端程序。
			uploadJson : GV.kindeditor_upload_url,
			// 指定浏览远程图片的服务器端程序。
			fileManagerJson : GV.kindeditor_file_manager_url,
			filterMode : false, //关闭过滤模式
			wellFormatMode : false, //true时美化HTML数据。false关闭美化
			newlineTag : "br", //设置回车换行标签，可设置”p”、”br”。数据类型: String 默认值: “p”
			pasteType : 2, //设置粘贴类型，0:禁止粘贴, 1:纯文本粘贴, 2:HTML粘贴 数据类型: Int 默认值: 2
			allowFileManager : true, //true时显示浏览远程服务器按钮。
			// 改变站内本地URL，可设置空、relative、absolute、domain。空为不修改URL，relative为相对路径，absolute为绝对路径，domain为带域名的绝对路径。数据类型：String
			// 默认值：空
			// 注: 3.4版本开始支持，3.4.1版本开始默认值为空。
			// urlType:'domain',
			// 编辑器的宽度，可以设置px或%，比textarea输入框样式表宽度优先度高。数据类型: String 默认值: textarea输入框的宽度
			width : '100%',
			// 编辑器的高度，只能设置px，比textarea输入框样式表高度优先度高。数据类型: String 默认值: textarea输入框的高度
			height : '390px',
			afterUpload:function(){ this.sync(); }, //图片上传后，将上传内容同步到textarea中
			afterBlur:function(){ this.sync(); }, //解决KindEditor编辑器Ajax表单提交时获取不到值问题
			// 上面的filterMode为true时以下就是要保留的标签
			/* htmlTags:{
				div : [
					'align', '.border', '.margin', '.padding', '.text-align', '.color',
					'.background-color', '.font-size', '.font-family', '.font-weight', '.background',
					'.font-style', '.text-decoration', '.vertical-align', '.margin-left'
				],
				table: [
					'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor',
					'.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color',
					'.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background',
					'.width', '.height', '.border-collapse'
				],
				img : ['src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
				'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
				'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
				'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
				],
			} */
		});
		prettyPrint();
		var editor3 = K.create('textarea[name="content_en"]', {
			// 指定编辑器iframe document的CSS文件，用于设置可视化区域的样式。
			cssPath : '__STATIC__/common/libs/kindeditor/plugins/code/prettify.css',
			// 指定上传文件的服务器端程序。
			uploadJson : GV.kindeditor_upload_url,
			// 指定浏览远程图片的服务器端程序。
			fileManagerJson : GV.kindeditor_file_manager_url,
			filterMode : false, //关闭过滤模式
			wellFormatMode : false, //true时美化HTML数据。false关闭美化
			newlineTag : "br", //设置回车换行标签，可设置”p”、”br”。数据类型: String 默认值: “p”
			pasteType : 2, //设置粘贴类型，0:禁止粘贴, 1:纯文本粘贴, 2:HTML粘贴 数据类型: Int 默认值: 2
			allowFileManager : true, //true时显示浏览远程服务器按钮。
			// 改变站内本地URL，可设置空、relative、absolute、domain。空为不修改URL，relative为相对路径，absolute为绝对路径，domain为带域名的绝对路径。数据类型：String
			// 默认值：空
			// 注: 3.4版本开始支持，3.4.1版本开始默认值为空。
			// urlType:'domain',
			// 编辑器的宽度，可以设置px或%，比textarea输入框样式表宽度优先度高。数据类型: String 默认值: textarea输入框的宽度
			width : '100%',
			// 编辑器的高度，只能设置px，比textarea输入框样式表高度优先度高。数据类型: String 默认值: textarea输入框的高度
			height : '390px',
			afterUpload:function(){ this.sync(); }, //图片上传后，将上传内容同步到textarea中
			afterBlur:function(){ this.sync(); }, //解决KindEditor编辑器Ajax表单提交时获取不到值问题
		});
		prettyPrint();
	});
</script> -->
{block name="content"}
<div class="layui-body" style="top: 0px;left: 0px;">
	<!-- 内容主体区域 -->
	<div class="layui-fluid" style="position: relative;margin: 0 auto;padding: 7px;padding-top: 0px;">
		<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
			<ul class="layui-tab-title">
				<li class="layui-this">基础</li>
				<li class="">高级</li>
				<li class="">内容</li>
				{if condition="isAddonInstall('member')"}
				<li class="">会员权限</li>
				{/if}
				{if condition="$UID eq 1"}
				<li class="">角色权限</li>
				{/if}
				{if condition="$fields"}
					{volist name="$fields" id="list"}
					<li>{:get_field_group($key)}</li>
					{/volist}
				{/if}
			</ul>
			<div class="layui-tab-content layui-setting form-horizontal">
				<div class="layui-tab-item  layui-show">
					<form class="layui-form layui-form-pane" name="form1" action="{:url('')}">
						<input type="hidden" name="id" value="{$info.id|default=''}" class="upload-text" />
						<div class="layui-form-item">
							<label class="layui-form-label">上级栏目</label>
							<div class="layui-input-block">
								<select name="pid" lay-verify="required" class="upload-select">
									<option value="0" selected="" pidname="">顶级分类</option>
									{volist name="allArctypeRes" id="category"}
									<option value="{$category.id}" pidname="{$category.name}"><?php if($category['level']!==0){echo '|';} echo str_repeat('-',$category['level']*5);?>{$category.typename}</option>
									{/volist}
								</select>
								<span class="layui-form-mid layui-word-aux">
									[ 上级栏目 ]
								</span>
								<span class="sysval"><em class="zerocopy">pid</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">绑定模型</label>
							<div class="layui-input-block">
								<select name="model_id" id='model' lay-verify="required" lay-filter="model" class="upload-select">
									{volist name=":get_document_model()" id="list"}
									<option value="{$list.id}" rule="{$list.name}">{$list.title} | {$list.name}</option>
									{/volist}
								</select>
								<span class="layui-form-mid layui-word-aux">
									[ 栏目支持发布的文档模型 ]
								</span>
								<span class="sysval"><em class="zerocopy">model_id</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">栏目名称</label>
							<div class="layui-input-block">
								<input type="text" name="typename"  value="{$info.typename|default=''}"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									[ 名称不能为空 ]
								</span>
								<span class="sysval"><em class="zerocopy">typename</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">英文栏目名称</label>
							<div class="layui-input-block">
								<input type="text" name="typename_en"  value="{$info.typename_en|default=''}"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									[ 英文栏目名称 ]
								</span>
								<span class="sysval"><em class="zerocopy">typename_en</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">栏目标识</label>
							<div class="layui-input-inline" style="width: 450px;">
								<input type="text" name="name"  value="{$info.name|default=''}"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									[ 英文字母 ]
								</span>
								<span class="sysval"><em class="zerocopy">name</em></span>
							</div>
							<div class="layui-input-inline">
								<input type="checkbox" title="拼音" {if condition="$info['name']"}checked=""{/if} lay-skin="primary" lay-filter="pinyin">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">文件保存目录</label>
							<div class="layui-input-inline" style="width: 450px;">
								<input type="text" name="typedir"  value="{$info.typedir|default=''}"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									[ 英文字母-文件保存目录(栏目目录) ]
								</span>
								<span class="sysval"><em class="zerocopy">typedir</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">排序</label>
							<div class="layui-input-block">
								<input type="text" name="sort"  value="{$info.sort|default='0'}"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									<!-- [ 由低 -> 高 ] -->
								</span>
								<span class="sysval"><em class="zerocopy">sort</em></span>
							</div>
						</div>
						<div class="layui-form-item" pane="" style="">
							<label class="layui-form-label">发布内容</label>
							<div class="layui-input-block">
								<input type="radio" name="allow_publish" value="0" title="不允许" class="upload-radio">
								<input type="radio" name="allow_publish" value="1" title="仅允许后台" class="upload-radio">
								<input type="radio" name="allow_publish" value="2" title='允许前后台' class="upload-radio">
								<span class="sysval"><em class="zerocopy">allow_publish</em></span>
							</div>
						</div>
						<div class="layui-form-item" pane="" style="">
							<label class="layui-form-label">是否审核</label>
							<div class="layui-input-block">
								<input type="radio" name="check" value="0" title="不需要" class="upload-radio">
								<input type="radio" name="check" value="1" title="需要" class="upload-radio">
								<span class="sysval"><em class="zerocopy">check</em></span>
							</div>
						</div>
						<div class="layui-form-item" pane="">
							<label class="layui-form-label">栏目属性</label>
							<div class="layui-input-block">
								<input type="radio" name="ispart" value="1" title="列表栏目（允许在本栏目发布文档，并生成文档列表）" class="upload-radio">
								<input type="radio" name="ispart" value="2" title="频道封面（栏目本身不允许发布文档）" class="upload-radio">
								<input type="radio" name="ispart" value="3" title='外部连接（在"文件保存目录"处填写网址）' class="upload-radio">
								<span class="sysval"><em class="zerocopy">ispart</em></span>
							</div>
						</div>
						<div class="layui-form-item" pane="">
							<label class="layui-form-label">显示</label>
							<div class="layui-input-block">
								<input type="radio" name="isfirst" value="1" title="是" class="upload-radio">
								<input type="radio" name="isfirst" value="0" title="否 [ 是否默认显示第一个子栏目内容 ] " class="upload-radio">
								<span class="sysval"><em class="zerocopy">isfirst</em></span>
							</div>
						</div>
						<!-- 栏目图片 -->
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">栏目图片</label>
								<div class="layui-input-block">
									<input type="file" filename="thumb" filetype="one" isajax="1" iscrop="1" data-size="" data-ext="" data-thumb="" data-watermark="" class="upload-file thumb" style="display: none">
									<input type="text" name="thumb" value="{$info.thumb|default=''}" class="layui-input upload-text" style="float:left;margin-right:-2px;width:300px;">
									<input type="button" value="浏览..." onclick="SelectImage('thumb');" class="layui-btn layui-btn-normal">
									<input type="button" value="站内选择" onclick="x_admin_show('站内选择','{:url('File/index',['filename'=>'thumb'])}')" class="layui-btn layui-btn-primary">
									<input type="button" value="选择" onclick="x_admin_show('选择','{:url('Attachment/index',['filename'=>'thumb'])}')" class="layui-btn layui-btn-primary">
									<input type="button" value="裁剪" onclick="caijian('thumb');" class="layui-btn layui-btn-primary">
									<!-- <input type="checkbox" name="ddisremote" value="1" title="远程"> -->
									<!-- <div class="layui-unselect layui-form-checkbox"><span>远程</span><i class="layui-icon layui-icon-ok"></i></div> -->
									<input type="button" value="thumb" class="layui-btn layui-btn-primary" style="background: #EDF6FF;">
								</div>
								<!-- <span class="layui-form-mid layui-word-aux">
									[ 栏目图片 ]
								</span> -->
								<!-- <div class="layui-input-inline">
									<span class="sysval"><em class="zerocopy">thumb</em></span>
								</div> -->
							</div>
							{if condition="$info['thumb']"}
							<div class="layui-inline thumb_list" id="thumb">
								<span>
									<img src="{$info.thumb|get_file_path=###}" alt="" height="100px;" width="100px" data-image>
									<button type="button" filename="thumb" filevalue="{$info.thumb}" onclick="delimg(this);" class="layui-btn layui-btn-danger layui-btn-mini delimg">
										<i class="layui-icon">&#xe640;</i>
									</button>
								</span>
							</div>
							{else /}
							<div class="layui-inline thumb_list" id="thumb"></div>
							{/if}
						</div>
						<div class="layui-form-item">
							<div class="layui-input-block" style="border: none;">
								<!-- <button class="layui-btn x_admin_close ajax-post2" type="submit" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button> -->
								<button class="layui-btn x_admin_close ajax-post2" type="button" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button>
								<button type="reset" class="layui-btn layui-btn-primary">重置</button>
								<!-- <button type="button" onclick="javascript:history.back(-1);return false;" class="layui-btn layui-btn-primary">返回</button> -->
							</div>
						</div>
					</form>
				</div>
				<div class="layui-tab-item">
					<form class="layui-form layui-form-pane" action="">
						<div class="layui-form-item">
							<label class="layui-form-label">频道封面页模板</label>
							<div class="layui-input-block">
								<input type="text" name="index_template"  value="{$info.index_template|default=''}"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									[ 封面模板 ]
								</span>
								<span class="sysval"><em class="zerocopy">index_template</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">列表页模板</label>
							<div class="layui-input-block">
								<input type="text" name="list_template"  value="{$info.list_template|default=''}"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									[ 列表模板 ]
								</span>
								<span class="sysval"><em class="zerocopy">list_template</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">文章内容页模板</label>
							<div class="layui-input-block">
								<input type="text" name="article_template"  value="{$info.article_template|default=''}"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									[ 文章内容页模板 ]
								</span>
								<span class="sysval"><em class="zerocopy">article_template</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">文章命名规则</label>
							<div class="layui-input-block">
								<input type="text" name="article_rule"  value="<?php if(isset($info['article_rule']) && !empty($info['article_rule'])){echo $info['article_rule'];}else{echo '{Y}/{M}{D}/{aid}.html';}?>"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									[ 文章命名规则 ]
								</span>
								<span class="sysval"><em class="zerocopy">article_rule</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">列表命名规则</label>
							<div class="layui-input-block">
								<input type="text" name="list_rule"  value="<?php if(isset($info['list_rule']) && !empty($info['list_rule'])){echo $info['list_rule'];}else{echo 'list_{tid}_{page}.html';}?>"  placeholder="" autocomplete="off" class="layui-input upload-text">
								<span class="layui-form-mid layui-word-aux">
									[ 列表命名规则 ]
								</span>
								<span class="sysval"><em class="zerocopy">list_rule</em></span>
							</div>
						</div>
						{if condition="$info.id"}
						<div class="layui-form-item" pane="">
							<label class="layui-form-label">继承选项</label>
							<div class="layui-input-block">
								<input type="checkbox" name="upnext" title="同时更改下级栏目的浏览权限、内容类型、模板风格、命名规则等通用属性" value="1" lay-skin="primary" class="upload-checkbox">
								<br>
								<!-- <span class="layui-form-mid layui-word-aux">
									[ 同时更改下级栏目的浏览权限、内容类型、模板风格、命名规则等通用属性 ]
								</span> -->
								<span class="sysval"><em class="zerocopy">upnext</em></span>
							</div>
						</div>
						{/if}
						<div class="layui-form-item">
							<div class="layui-input-block" style="border: none;">
								<!-- <button class="layui-btn x_admin_close ajax-post2" type="submit" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button> -->
								<button class="layui-btn x_admin_close ajax-post2" type="button" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button>
								<button type="reset" class="layui-btn layui-btn-primary">重置</button>
								<!-- <button type="button" onclick="javascript:history.back(-1);return false;" class="layui-btn layui-btn-primary">返回</button> -->
							</div>
						</div>
					</form>
				</div>
				<div class="layui-tab-item">
					<form class="layui-form layui-form-pane" action="">
						<div class="layui-form-item">
							<!-- <label class="layui-form-label">栏目内容</label> -->
							<div class="layui-input-block" style="margin-left:0px;">
								<textarea id="content" name="content" placeholder="" class="layui-textarea textarea-kindeditor upload-text">{$info.content|default=''}</textarea>
								<span class="layui-form-mid layui-word-aux">
									[ 栏目内容&nbsp;字段名:{content} ]
								</span>
								<span class="sysval"><em class="zerocopy">content</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<!-- <label class="layui-form-label">栏目内容</label> -->
							<div class="layui-input-block" style="margin-left:0px;">
								<textarea id="content_en" name="content_en" placeholder="" class="layui-textarea textarea-kindeditor upload-text">{$info.content_en|default=''}</textarea>
								<span class="layui-form-mid layui-word-aux">
									[ 英文栏目内容&nbsp;字段名:{content_en} ]
								</span>
								<span class="sysval"><em class="zerocopy">content_en</em></span>
							</div>
						</div>
						<div class="layui-form-item">
							<div class="layui-input-block" style="border: none;">
								<!-- <button class="layui-btn x_admin_close ajax-post2" type="submit" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button> -->
								<button class="layui-btn x_admin_close ajax-post2" type="button" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button>
								<button type="reset" class="layui-btn layui-btn-primary">重置</button>
								<!-- <button type="button" onclick="javascript:history.back(-1);return false;" class="layui-btn layui-btn-primary">返回</button> -->
							</div>
						</div>
					</form>
				</div>
				{if condition="isAddonInstall('member')"}
				<div class="layui-tab-item">
					<form class="layui-form layui-form-pane" action="">
					<div class="layui-form-item">
						<label>前台文档权限</label>
						<table class="layui-table" style="max-width: 250px;">
						    <colgroup>
								<col width="150">
								<col width="100">
						    </colgroup>
						  	<thead>
								<tr>
									<th>会员组名称</th>
									<th>允许投稿</th>
								</tr> 
						  	</thead>
						  	<tbody>
							{volist name="Member_Group" id="vo"}
							<tr>
							  	<td>{$vo.name}</td>
							  	<td><input type="checkbox" name="priv_groupid[]" value="add,{$vo.id}" class="upload-checkbox" title="允许" lay-skin="primary"></td>
							</tr>
							{/volist}
						  	</tbody>
						</table>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block" style="border: none;">
							<!-- <button class="layui-btn x_admin_close ajax-post2" type="submit" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button> -->
							<button class="layui-btn x_admin_close ajax-post2" type="button" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
							<!-- <button type="button" onclick="javascript:history.back(-1);return false;" class="layui-btn layui-btn-primary">返回</button> -->
						</div>
					</div>
					</form>
				</div>
				{/if}
				{if condition="$UID eq 1"}
				<div class="layui-tab-item">
					<form class="layui-form layui-form-pane" action="">
					<div class="layui-form-item">
						<label>后台文档权限</label>
						<table class="layui-table">
						    <colgroup>
								<col width="150">
								<col width="100">
								<col width="100">
								<col width="100">
								<col width="100">
								<col width="100">
								<col width="100">
								<col width="100">
								<col width="100">
						    </colgroup>
						  	<thead>
								<tr>
									<th style="text-align: center;">角色组名称</th>
									<th style="text-align: center;">新增文档</th>
									<th style="text-align: center;">编辑文档</th>
									<th style="text-align: center;">查看文档</th>
									<th style="text-align: center;">删除文档</th>
									<th style="text-align: center;">复制文档</th>
									<th style="text-align: center;">移动文档</th>
									<th style="text-align: center;">文档状态</th>
									<th style="text-align: center;">文档排序</th>
								</tr> 
						  	</thead>
						  	<tbody>
							{volist name="auth_group" id="vo"}
							<tr>
							  	<td style="text-align: center;">{$vo.title}</td>
								<td style="text-align: center;"><input type="checkbox" name="priv_auth_groupid[]" value="add,{$vo.id}" class="upload-checkbox" title="允许" lay-skin="primary"></td>
								<td style="text-align: center;"><input type="checkbox" name="priv_auth_groupid[]" value="edit,{$vo.id}" class="upload-checkbox" title="允许" lay-skin="primary"></td>
								<td style="text-align: center;"><input type="checkbox" name="priv_auth_groupid[]" value="select,{$vo.id}" class="upload-checkbox" title="允许" lay-skin="primary"></td>
								<td style="text-align: center;"><input type="checkbox" name="priv_auth_groupid[]" value="delete,{$vo.id}" class="upload-checkbox" title="允许" lay-skin="primary"></td>
								<td style="text-align: center;"><input type="checkbox" name="priv_auth_groupid[]" value="copy,{$vo.id}" class="upload-checkbox" title="允许" lay-skin="primary"></td>
								<td style="text-align: center;"><input type="checkbox" name="priv_auth_groupid[]" value="move,{$vo.id}" class="upload-checkbox" title="允许" lay-skin="primary"></td>
								<td style="text-align: center;"><input type="checkbox" name="priv_auth_groupid[]" value="status,{$vo.id}" class="upload-checkbox" title="允许" lay-skin="primary"></td>
								<td style="text-align: center;"><input type="checkbox" name="priv_auth_groupid[]" value="sort,{$vo.id}" class="upload-checkbox" title="允许" lay-skin="primary"></td>
							</tr>
							{/volist}
						  	</tbody>
						</table>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block" style="border: none;">
							<!-- <button class="layui-btn x_admin_close ajax-post2" type="submit" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button> -->
							<button class="layui-btn x_admin_close ajax-post2" type="button" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
							<!-- <button type="button" onclick="javascript:history.back(-1);return false;" class="layui-btn layui-btn-primary">返回</button> -->
						</div>
					</div>
					</form>
				</div>
				{/if}
				<!-- 所有字段 start -->
				{if condition="$fields"}
				{volist name="$fields" id="list"}
				<div class="layui-tab-item">		
					<form class="layui-form layui-form-pane" action="{:url('add')}">
						{volist name="list" id="field"}
						{if condition="($field['is_show'] == 1 || $field['is_show'] == 2) AND $field['status'] ==1"}
						{php} echo \think\Response::create('admin@layouts/inputitem', 'view')->assign('field', $field)->getContent(); {/php}
						{/if}
						{/volist}
						<div class="layui-form-item">
							<div class="layui-input-inline" style="padding-left: 142px;width: 320px;">
								<!-- <button  class="layui-btn x_admin_close ajax-post2" type="submit" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button> -->
								<!-- 防止回车提交 -->
								<button class="layui-btn x_admin_close ajax-post2" type="button" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button>
								<button type="reset" class="layui-btn layui-btn-primary">重置</button>
								<!-- <button type="button" onclick="javascript:history.back(-1);return false;" class="layui-btn layui-btn-primary">返回</button> -->
							</div>
						</div>
					</form>
				</div>
				{/volist}
				{/if}
				<!-- 所有字段 end -->
			</div>
		</div>
	</div>
</div>
{/block}
{block name="js"}
<script type="text/javascript">
	layui.use(['form','layer','jquery'], function(){
		var form = layui.form, //表单
		layer = layui.layer, //弹层
		$ = layui.jquery; //jquery
	    // 监听checkbox拼音
	    form.on('checkbox(pinyin)', function(data){
			console.log(data.elem); //得到checkbox原始DOM对象
			console.log(data.elem.checked); //是否被选中，true或者false
			console.log(data.value); //复选框value值，也可以通过data.elem.value得到
			console.log(data.othis); //得到美化后的DOM对象
			var typename = $("input[name='typename']").val();
			// 上级栏目标识
			var pidname = $("select[name='pid']").find("option:selected").attr("pidname");
			var pid = $("select[name='pid']").find("option:selected").val();
			if(data.elem.checked){
				if(!typename){
					$(data.elem).prop('checked','');
					form.render();
					layer.msg('清先填写栏目名称',{time:1000});
					return false;
				}
				$.ajax({
					type:"post",
					data:{typename:typename,pidname:pidname,pid:pid},
					url:"{:url('get_pinyin')}",
					dataType:"json",
					success:function(data){
						$("input[name='name']").val(data);
					}
				});
			}else{
				$("input[name='name']").val('');
			}
		});
		// 监听select模型
		form.on('select(model)', function(data){
		    console.log(data.elem); //得到select原始DOM对象
		    console.log(data.value); //得到被选中的值
		    console.log(data.othis); //得到美化后的DOM对象
		    var sevvalue = $(data.elem).find('option:selected').attr('rule');
		    var indextemplate = document.getElementsByName('index_template');
		    var listtemplate = document.getElementsByName('list_template');
		    var articletemplate = document.getElementsByName('article_template');
		    indextemplate[0].value = "index_"+sevvalue+".html";
		    listtemplate[0].value = "list_"+sevvalue+".html";
		    articletemplate[0].value = "article_"+sevvalue+".html";
		});
	});
</script>
<script type="text/javascript">
    $("select[name='pid']").val({$info.pid|default=$id}); //设置栏目中项
    $("select[name='model_id']").val({$info.model_id|default=$model_id}); //设置模型选中
    $("input[name='allow_publish'][value={$info.allow_publish|default = 1}]").attr("checked","checked");
    $("input[name='check'][value={$info.check|default = 0}]").attr("checked","checked");
    $("input[name='ispart'][value={$info.ispart|default = 1}]").attr("checked","checked");
    $("input[name='isfirst'][value={$info.isfirst|default = 0}]").attr("checked","checked");
    $(function(){
    	$("select[name='model_id']").change(function(){
    		var sevvalue = $(this).find('option:selected').attr('rule');
    		var indextemplate = document.getElementsByName('index_template');
    		var listtemplate = document.getElementsByName('list_template');
    		var articletemplate = document.getElementsByName('article_template');
    		indextemplate[0].value = "index_"+sevvalue+".html";
    		listtemplate[0].value = "list_"+sevvalue+".html";
    		articletemplate[0].value = "article_"+sevvalue+".html";
    	});
    });
    <?php if(empty($info['model_id'])):?>
		$("select[name='model_id']").ready(function(){
			$("select[name='model_id']").trigger("change");
		});
	<?php endif;?>
	xuanran();//更新渲染
</script>
{/block}
